/**
 * Copyright (C) 2012 Foxit Corporation.
 * All Rights Reserved.
 *
 * The following code is copyrighted and contains proprietary information and trade secrets of Foxit Corporation.<br> 
 * You can only redistribute files listed below to customers of your application, under a written SDK license agreement with Foxit.<br>
 * You cannot distribute any part of the SDK to general public, even with a SDK license agreement.<br>
 * Without SDK license agreement, you cannot redistribute anything.
 * 
 * @file	fpdfbase.h
 * @brief	Header file for the PDF base module. 
 * @note	If you want to purchase Foxit PDF SDK license and use ANY of the following functions, please
 *			request for enabling PDF base module explicitly. 
 */
  
/** 
 * @addtogroup FGSPDFBASE PDF Base
 * @brief Methods in this module are included in fpdfbase.h .
 */
/**@{*/

#ifndef __FGSPDFBASE__
#define __FGSPDFBASE__

#include "../dp/fgsdp.h"


#ifdef __cplusplus
extern "C" {
#endif
    
/**
 * @name    Page Margin Mode
 * @note	Currently Foxit SDK supports two modes to calculate page margin:<br>
 * 			one is analyzing bounding box of all page contents,
 * 			another is detecting paths which seem background or images which need calculate margin.
 */
/**@{*/
    enum {
    /** Calculate margin according to bounding box of all contents. */
    kFGSPDFPageMarginContentsBbox   = 0,
    /** Calculate margin by detecting paths or images. */
    kFGSPDFPageMarginDetection      = 1
};
/** @brief Alias of enumeration for page margin mode. */
typedef UInt32 FGSPDFPageMarginMode;
/**@}*/
    

/** 
 * @name FGSPDFBASE Enumeration Types
 */

/**@{*/
/**
 * @brief FGSPDF Zoom Mode 
 */
enum {    
    /**  Zoom level with specified offset.*/    
    kFGSPDFZoomModeXYZ           = 1,
    /**  Fit both the width and height of the page (whichever smaller).*/
    kFGSPDFZoomModeFitPage       = 2,    
    /**  Fit the page width.*/
    kFGSPDFZoomModeFitHorz       = 3,
    /**  Fit the page height.*/ 
    kFGSPDFZoomModeFitVert       = 4,   
    /**  Fit a specific rectangle area within the window.*/
    kFGSPDFZoomModeFitRect       = 5,    
    /**  Fit the bounding box entirely within the window both horizontally and vertically. */
    kFGSPDFZoomModeFitBBox       = 6,    
    /**  The contents of the page magnified just enough to fit the entire width of its bounding box within the windw.*/
    kFGSPDFZoomModeFitBHorz      = 7,    
    /**  The contents of the page magnified just enough to fit the entire height of its bounding box within the window.*/
    kFGSPDFZoomModeFitBVert      = 8
};
/** @brief Alias of enumeration for zoom-mode. */
typedef UInt32 FGSPDFZoomMode;

/**
 * @brief FGSPDF Annot Type
 */
enum {
    /**  No or unsupported annotation. */
    kFGSPDFAnnotTypeUnknown           = 0,
    /**  Note annotation. */
    kFGSPDFAnnotTypeNote              = 1,
    /**  Highlight annotation. */
    kFGSPDFAnnotTypeHighLight         = 2,
    /**  Pencil annotation. */
    kFGSPDFAnnotTypePencil            = 3,
    /**  Stamp annotation. */
    kFGSPDFAnnotTypeStamp             = 4,
    /**  File attachment annotation. */
    kFGSPDFAnnotTypeFileAttachment    = 5,
    /**  Link annotation. */
    kFGSPDFAnnotTypeLink              = 6,
    /**  Square annotation. */
    kFGSPDFAnnotTypeSquare            = 7,
    /**  Circle annotation. */
    kFGSPDFAnnotTypeCircle            = 8,
    /**  Line annotation. */
    kFGSPDFAnnotTypeLine              = 9,
    /**  Underline annotation. */
    kFGSPDFAnnotTypeUnderLine         = 10,
    /**  Strikeout annotation. */
    kFGSPDFAnnotTypeStrikeOut         = 11,
    /**  Squiggle annotation. */
    kFGSPDFAnnotTypeSquiggly          = 12,
    /**  FreeText annotation. */
    kFGSPDFAnnotTypeFreeText          = 13,
    /**  Screen annotation. */
    kFGSPDFAnnotTypeScreen            = 14
};
/** @brief Alias of enumeration for annotation type. */
typedef UInt32 FGSPDFAnnotType;
    
/**
 * @brief FGSPDF Saving Flag
 */
enum {
    /**  Save the document incrementally. */
    kFGSPDFSaveAsIncremental = 1,
    /**  Save the document without the original one. */
    kFGSPDFSaveAsNooriginal  = 2,
    /**  Save the document progressively. */ 
    kFGSPDFSaveAsProgressive = 4
};
/** @brief Alias of enumeration for saving flag. */
typedef UInt32 FGSPDFSavingFlag;

/**
 * @brief FGSPDF Permission type
 */
enum {
    /**
     *  bit 3.<br>
     * - (Revision 2) Print the document.
     * - (Revision 3 or greater) Print the document (possibly not at the highest
     * quality level, depending on whether bit 12 is also set). 
     */
    kFGSPDFPermissionPrint          = 0x0004,
    /**
     *  bit 4.<br> 
     * Modify the contents of the document by operations other than 
     * those controlled by bits 6, 9, and 11.
     */
    kFGSPDFPermissionModify         = 0x0008,
    /**
     *  bit 5.<br>
     * - (Revision 2) Copy or otherwise extract text and graphics from the 
     * document, including extracting text and graphics (in support of accessibility
     * to users with disabilities or for other purposes).
     * - (Revision 3 or greater) Copy or otherwise extract text and graphics 
     * from the document by operations other than that controlled by bit 10.
     */
    kFGSPDFPermissionExtract        = 0x0010,
    /**
     *  bit 6.<br> 
     * Add or modify text annotations, fill in interactive form fields, and, 
     * if bit 4 is also set, create or modify interactive form fields (including signature fields).
     */
    kFGSPDFPermissionAnnotForm      = 0x0020,
    /**
     *  bit 9.<br> 
     * (Revision 3 or greater) Fill in existing interactive form fields (including signature fields),
     * even if bit 6 is clear. 
     */
    kFGSPDFPermissionFillForm       = 0x0100,
    /**
     *  bit 10.<br> 
     * (Revision 3 or greater) Extract text and graphics (in support of accessibility
     * to users with disabilities or for other purposes). 
     */
    kFGSPDFPermissionExtractAccess  = 0x0200,
    /**
     *  bit 11.<br>
     * (Revision 3 or greater) Assemble the document (insert, rotate, or delete pages
     * and create bookmarks or thumbnail images), even if bit 4 is clear. 
     */
    kFGSPDFPermissionAssemble       = 0x0400,
    /**
     *  bit 12.<br>
     * (Revision 3 or greater) Print the document to a representation from 
     * which a faithful digital copy of the PDF content could be generated. 
     * When this bit is clear (and bit 3 is set), printing is limited to a low-level
     * representation of the appearance, possibly of degraded quality. 
     * (See implementation note 25 in Appendix H.) 
     */
    kFGSPDFPermissionPrintHigh      = 0x0800
};
/** @brief Alias of enumeration for permission type. */
typedef UInt32 FGSPDFPermissions;

/**
 * @brief FGSPDF Encoding type
 */
enum {
    /**  Whatever internal encoding in the font. */
    kFGSPDFEncodingInternal          = 0,
    /**  Unicode encoding. */
    kFGSPDFEncodingUnicode           = 1
};
/** @brief Alias of enumeration for encoding type. */
typedef UInt32 FGSPDFEncoding;


/**
 * @brief FGSPDF Render Flag  
 */
enum {
    /**  Set if annotations are to be rendered. */
    kFGSPDFRenderAnnot              = 0x01,
    /**  Set if using text rendering optimized for LCD display. */
    kFGSPDFRenderLCDText            = 0x02,
    /**  Set if the device is using BGR LCD stripe. */
    kFGSPDFRenderBGRStripe          = 0x04,
    /**  Drop the page objects that are rendered. This will make the most complicated pages renderable
     within very limited memory. <b>HOWEVER</b>, after rendering the page will not be useable anymore! You will
     have to close the page and start it over! */
    kFGSPDFRenderDropObjects        = 0x08,
    /**  Set if the form fields(widgets) are not to be rendered.*/
    kFGSPDFRenderNoWidget           = 0x10,
    /**  Set if do not need rotate or scale annotation icon, for "Text" and "FileAttachment" only at present. */
    kFGSPDFRenderNottransFormIcon   = 0x20,
    /**  Limit image cache size. */
    kFGSPDFRenderLimitedImageCache  = 0x40,
    /**  Always use anti-aliasing for rectangle drawing. */
    kFGSPDFRenderUseAA				= 0x80,
    /**  Grayscale output. Only used in ::FPDF_FormFill_Draw. */
    kFGSPDFRenderGrayScale          = 0x100,
    /**  Whether is for printing. */
    kFGSPDFRenderPrint              = 0x200
};
/** @brief Alias of enumeration for render flag. */
typedef UInt32 FGSPDFRenderFlag;

/**
 * @brief Enum Definitions for action types. 
 */
enum {
    /** Unsupported action type.*/
    kFGSPDFActionUnsupported        = 0,
    /** Go to a destination within current document.*/
    kFGSPDFActionGoto               = 1,
    /** Go to a destination within another document.*/
    kFGSPDFActionRemoteGoto         = 2,
    /** Universal Resource Identifier, including web pages and other Internet based resources.*/
    kFGSPDFActionURL                = 3,
    /** Launch an application or open a file.*/
    kFGSPDFActionLaunch             = 4,
    /** Play a multimedia.*/
	kFGSPDFActionRendition          = 5,
};
/** @brief Alias of enumeration for action type. */
typedef UInt32 FGSPDFActionType;

/**
 * @brief FGSPDF Page Object Type
 */
enum {
    /** Invalid object type */
    kFGSPDFPageObjInvalid = 0,
    /**  Text object */
    kFGSPDFPageObjText    = 1,
    /**  Path object */
    kFGSPDFPageObjPath    = 2,
    /**  Image object */
    kFGSPDFPageObjImage   = 3,
    /**  Shading object */
    kFGSPDFPageObjShading = 4,
    /**  From object */
    kFGSPDFPageObjForm    = 5
};
/** @brief Alias of enumeration for page object type. */
typedef UInt32 FGSPDFPageObjType;

/**
 * @brief FGSPDF Search Flag
 */
enum {
    /**  Whether matching case. */
    kFGSPDFMatchCase            = 1,
    /**  Whether matching whole word. */
    kFGSPDFMatchWholeWord       = 2,
    /**  (This is not supported now. Maybe this will be supported in a later release.)Whether matching consecutively (for example, "CC" will match twice in "CCC").*/
    kFGSPDFMatchConsecutive     = 4
};
/** @brief Alias of enumeration for search flag. */
typedef UInt32 FGSPDFSearchFlag;
   
/**
 * @brief FGSPDF Page Mode
 */
enum {
    /**  Unknown value. */
    kFGSPDFPageModeUnknown           = -1,
    /**  Neither document outline nor thumbnail image is visible. */
    kFGSPDFPageModeUseNone           = 0,
    /**  Document outline is visible. */
    kFGSPDFPageModeUseOutLines       = 1,
    /**  Thumbnial images are visible. */
    kFGSPDFPageModeUseThumbs         = 2,
    /**  Full-screen mode: no menu bar and window controls, and any other window is invisible. */
    kFGSPDFPageModeFullScreen        = 3,
    /**  The optional content group panel is visible. */
    kFGSPDFPageModeUseOC             = 4,
    /**  Attachments panel is visible. */
    kFGSPDFPageModeUseAttachments    = 5
};
/** @brief Alias of enumeration for page mode. */
typedef UInt32 FGSPDFPageMode;

/**
 * @brief FGSPDF Object Type
 */
enum {
    /**  invalid object. */
    kFGSPDFObjectInvalid             = 0,
    /**  Boolean value. */
    kFGSPDFObjectBoolean             = 1,
    /**  Integer and real number. */
    kFGSPDFObjectNumber              = 2,
    /**  String. */
    kFGSPDFObjectString              = 3,
    /**  Name. */
    kFGSPDFObjectName                = 4,
    /**  Array. */
    kFGSPDFObjectArray               = 5,
    /**  Dictionary. */
    kFGSPDFObjectDictionary          = 6,
    /**  Stream. */
    kFGSPDFObjectStream              = 7,
    /**  the null object. */
    kFGSPDFObjectNull                = 8
};
/** @brief Alias of enumeration for object type. */
typedef UInt32 FGSPDFObjectType;  
/**@}*/
  
/**
 * @name Macro definitions for annotation type name
 */
/**@{*/
/** @brief Caret annotation. */
extern const CFStringRef kFPDFAnnotTypeNameCaret;
/** @brief Circle annotation. */
extern const CFStringRef kFPDFAnnotTypeNameCircle;
/** @brief File attachment annotation. */
extern const CFStringRef kFPDFAnnotTypeNameFileAttachment;
/** @brief Free text annotation. */
extern const CFStringRef kFPDFAnnotTypeNameFreeText;
/** @brief Highlight annotation. */
extern const CFStringRef kFPDFAnnotTypeNameHighLight;
/** @brief Line annotation. */
extern const CFStringRef kFPDFAnnotTypeNameLine;
/** @brief Link annotation. */
extern const CFStringRef kFPDFAnnotTypeNameLink;
/** @brief Movie annotation. */
extern const CFStringRef kFPDFAnnotTypeNameMovie;
/** @brief Text/Note annotation. */
extern const CFStringRef kFPDFAnnotTypeNameText;
/** @brief Ink/Pencil annotation. */
extern const CFStringRef kFPDFAnnotTypeNameInk;
/** @brief Polygon annotation. */
extern const CFStringRef kFPDFAnnotTypeNamePolygon;
/** @brief Polyline annotation. */
extern const CFStringRef kFPDFAnnotTypeNamePolyLine;
/** @brief Pop-up annotation. */
extern const CFStringRef kFPDFAnnotTypeNamePopup;
/** @brief Printer's mark annotation. */
extern const CFStringRef kFPDFAnnotTypeNamePrinterMark;
/** @brief Screen annotation. */
extern const CFStringRef kFPDFAnnotTypeNameScreen;
/** @brief Sound annotation. */
extern const CFStringRef kFPDFAnnotTypeNameSound;
/** @brief Square annotation. */
extern const CFStringRef kFPDFAnnotTypeNameSquare;
/** @brief Squiggly-underline annotation. */
extern const CFStringRef kFPDFAnnotTypeNameSquiggly;
/** @brief Rubber stamp annotation. */
extern const CFStringRef kFPDFAnnotTypeNameStamp;
/** @brief Strikeout annotation. */
extern const CFStringRef kFPDFAnnotTypeNameStrikeOut;
/** @brief Trap network annotation. */
extern const CFStringRef kFPDFAnnotTypeNameTrapNet;
/** @brief Underline annotation. */
extern const CFStringRef kFPDFAnnotTypeNameUnderLine;
/** @brief Widget annotation. */
extern const CFStringRef kFPDFAnnotTypeNameWidget;
/** @brief Watermark annotation. */
extern const CFStringRef kFPDFAnnotTypeNameWatermark;
/** @brief 3D annotation. */
extern const CFStringRef kFPDFAnnotTypeName3D;
/**@}*/

/**
 * @group Reference Definitions
 */

/**@{*/
/**
 * @defined __FGSPDFDocument
 * @abstract FGSPDF Document Reference.
 */
typedef const struct __FGSPDFDocument * FGSPDFDocumentRef;

/**
 * @defined __FGSPDFPage
 * @abstract FGSPDF Page Reference.
 */
typedef const struct __FGSPDFPage * FGSPDFPageRef;
    
/**
 * @defined __FGSPDFTextPage
 * @abstract FGSPDF TextPage Reference.
 */
typedef const struct __FGSPDFTextPage * FGSPDFTextPageRef;

/**
 * @defined __FGSPDFTextSearchHandle
 * @abstract FGSPDF TextSearchHandle Reference.
 */
typedef const struct __FGSPDFTextSearchHandle * FGSPDFTextSearchHandleRef;

/**
 * @defined __FGSPDFPageLink
 * @abstract FGSPDF PageLink Reference.
 */
typedef const struct __FGSPDFPageLink * FGSPDFPageLinkRef;

/**
 * @defined __FGSPDFAction
 * @abstract FGSPDF Action Reference.
 */
typedef const struct __FGSPDFAction * FGSPDFActionRef;

/**
 * @defined __FGSPDFRendition
 * @abstract FGSPDF Rendition Reference.
 */
typedef const struct __FGSPDFRendition * FGSPDFRenditionRef;

/**
 * @defined __FGSPDFBookmark
 * @abstract FGSPDF Bookmark Reference.
 */
typedef const struct __FGSPDFBookmark * FGSPDFBookmarkRef;

/**
 * @defined __FGSPDFAnnot
 * @abstract FGSPDF Annotation Reference.
 */
typedef const struct __FGSPDFAnnot * FGSPDFAnnotRef;

/**
 * @defined __FGSPDFObject
 * @abstract FGSPDF Object Reference.
 */
typedef const struct __FGSPDFObject * FGSPDFObjectRef;

/**
 * @defined __FGSPDFEncryptParams
 * @abstract FGSPDF Encrypt Reference.
 */
typedef const struct __FGSPDFEncryptParams * FGSPDFEncryptParamsRef;

/**
 * @defined __FGSPDFDrmCryptoHandler
 * @abstract FGSPDF DrmCrypto Reference.
 */
typedef const struct __FGSPDFDrmCryptoHandler * FGSPDFDrmCryptoHandlerRef;

/**
 * @defined __FGSPDFFileSpec
 * @abstract FGSPDF FileSpec Reference.
 */
typedef const struct __FGSPDFFileSpec * FGSPDFFileSpecRef;

/**
 * @defined __FGSPDFPageObject
 * @abstract FGS Page object Reference.
 */
typedef const struct __FGSPDFPageObject * FGSPDFPageObjectRef;

/**
 * @defined __FGSPDFPageObjects
 * @abstract FGS Page objects Reference.
 */
typedef const struct __FGSPDFPageObjects * FGSPDFPageObjectsRef;
    
/**
 * @defined __FGSPDFPath
 * @abstract FGS Path Reference.
 */
typedef const struct __FGSPDFPath * FGSPDFPathRef;
    
/**
 * @defined __FGSPDFPath
 * @abstract FGS Path Reference.
 */
typedef const struct __FGSPDFFont * FGSPDFFontRef;

/**
 * @defined __FGSPDFEnvelopes
 * @abstract FGS Envelopes Reference.
 */
typedef const struct __FGSPDFEnvelopes * FGSPDFEnvelopesRef;

/**
 * @defined __FGSPDFSignatureField
 * @abstract FGS SignatureField Reference.
 */
typedef const struct __FGSPDFSignatureField * FGSPDFSignatureFieldRef;

/**
 * @defined __FGSPDFFormEnv
 * @abstract FGS FormEnv Reference.
 */
typedef const struct __FGSPDFFormEnv * FGSPDFFormEnvRef;
    
/**
 * @defined __FGSPDFFormField
 * @abstract FGS FormField Reference.
 */
typedef const struct __FGSPDFFormField * FGSPDFFormFieldRef;

/**
 * @defined __FGSPDFForm
 * @abstract FGS Form Reference.
 */
typedef const struct __FGSPDFForm * FGSPDFFormRef;

/**
 * @defined __FGSPDFFormControl
 * @abstract FGS FormControl Reference.
 */
typedef const struct __FGSPDFFormControl * FGSPDFFormControlRef;

/**
 * @defined __FGSFDFDocument
 * @abstract FGS Document Reference.
 */
typedef const struct __FGSFDFDocument * FGSFDFDocumentRef;

/**
 * @defined __FGSPDFSecurity
 * @abstract FGS Security Reference.
 */
typedef const struct __FGSPDFSecurity * FGSPDFSecurityRef;
    
/**
 * @defined __FGSPDFObjectPos
 * @abstract FGS ObjectPos Reference.
 */    
typedef const struct __FGSPDFPageObjectPos * FGSPDFPageObjectPosRef;
    
/**
 * @defined __FGSPDFAsync
 * @abstract FGS Async Reference.
 */    
typedef const struct __FGSPDFAsync * FGSPDFAsyncRef;
/** @}*/
    
/** 
* @brief Structure for a page destination. 
*/
typedef struct __FGSPDFPageDest {
    
    SInt32                  pageIndex;/**< @brief Zero based index for the page. */    
    FGSPDFZoomMode			zoomMode;/**< @brief See macro definitions .*/    
    Float32                 zoomFactor;/**< @brief For FPDF_ZOOM_FACTOR only: the zoom factor (in percentage). */
    /**
	 * @brief A rectangle used to specify the position inside the page. 
	 * @details According to the zoom mode, different members of the rectangle are used: 
	 */
    CGRect                  position;        
} FGSPDFPageDest;

/** 
* @brief Structure for a document destination. 
*/
typedef struct __FGSPDFDocDest {
	/** The page data. */
	FGSPDFPageDest         pageData;
	/** The file name, encoded in UTF-16.*/	
	CFStringRef				fileName;
} FGSPDFDocDest;
 
/**
 * @brief FGSPDFDocDest Release Function
 */
void FGSPDFDocDestRelease(FGSPDFDocDest docDest);

/** 
 * @name FGSPDFBASE Enumeration Types
 */

/**@{*/
/**
 * @brief Flags for rect type
 */
enum {
    /** The visible rectangle.*/
    kFGSPDFRectPage                  = 0,
    /** The bounding box of the all object in this page.*/
    kFGSPDFRectBounding              = 1,
    /** The boundaries of the physical medium on which the page is to be printed.*/
    kFGSPDFRectMediaBox              = 2,
    /** The region to which the contents of the page are to be clipped (cropped) when displayed or printed. */
    kFGSPDFRectCropBox               = 3,
    /** The region to which the contents of the page should be clipped when output in a production environment. */
    kFGSPDFRectTrimBox               = 4,
    /** The intended dimensions of the finished page after trimming. */
    kFGSPDFRectArtBox                = 5,
    /** The extent of the page's meaningful content (including potential white space) as intended by the page's creator.*/
    kFGSPDFRectBleedBox              = 6,
};
/** @brief Alias of enumeration for rect type. */
typedef UInt32 FGSPDFRectType;

/**
 * @brief Enum Definitions for bookmark font style 
 */
enum {
    /** Normal typeface */
    kFGSBookmarkFontNormal = 0x00,
    /** Italic */
    kFGSBookmarkFontItalic = 0x01,
    /** Bold*/
    kFGSBookmarkFontBold   = 0x02,
};
/** @brief Alias of enumeration for bookmark font style. */
typedef UInt32 FGSBookmarkFontStyle;
/** @}*/

/** 
 * @brief FileSpec
 */	    
FGSPDFFileSpecRef FGSPDFAnnotCreateFileSpec(FGSPDFDocumentRef document);

/** 
 * @brief Get FileSpec Embedded File
 */	    
FGSFileStreamInRef FGSPDFAnnotGetFileSpecEmbeddedFile(FGSPDFFileSpecRef fileSpec);

/** 
 * @brief Set FileSpec Embedded File
 */	     
FGSErrorRet FGSPDFAnnotSetFileSpecEmbeddedFile(FGSPDFFileSpecRef fileSpec, FGSPDFDocumentRef document, CFStringRef file_path);
 
/** 
 * @name FGSPDFBASE Enumeration Types
 */

/**@{*/
/**
 * @brief Definitions for note annotation icon type.
 */
enum {
	/**  No or unsupported icon. */
    kFGSPDFNoteIconUnknown              = (UInt32)-1,
	/**  Note icon type Checkmark. */
    kFGSPDFNoteIconCheckMark            = 0,
	/**  Note icon type Circle. */
	kFGSPDFNoteIconCircle               = 1,
	/**  Note icon type Comment. */
	kFGSPDFNoteIconComment              = 2,
	/**  Note icon type Cross. */
	kFGSPDFNoteIconCross                = 3,
	/**  Note icon type Help. */
	kFGSPDFNoteIconHelp                 = 4,
	/**  Note icon type Insert. */
	kFGSPDFNoteIconInsert               = 5,
	/**  Note icon type Key. */
	kFGSPDFNoteIconKey                  = 6,
	/**  Note icon type New Paragraph. */
	kFGSPDFNoteIconNewParagraph         = 7,
	/**  Note icon type Note. */
	kFGSPDFNoteIconNote                 = 8,
	/**  Note icon type Paragraph. */
	kFGSPDFNoteIconParagraph            = 9,
	/**  Note icon type Right Arrow. */
	kFGSPDFNoteIconRighArrow            = 10,
	/**  Note icon type Right Pointer. */
	kFGSPDFNoteIconRighPointer          = 11,
	/**  Note icon type Star. */
	kFGSPDFNoteIconStar                 = 12,
	/**  Note icon type Up Arrow. */
	kFGSPDFNoteIconUpArrow              = 13,
	/**  Note icon type Upleft Arrow. */
	kFGSPDFNoteIconUpLeltArrow          = 14,
};
/** @brief Alias of enumeration for note annotation icon type. */
typedef UInt32 FGSPDFNoteIconType;
    
/**
 * @brief Line cap styles
 */
enum {
    /** The stroke is squared off at the endpoint of the path. There is no projection beyond the end of the path. */
    kFGSPDFLineCapButt                  = 0,
    /** A semicircular arc with a diameter equal to the line width is drawn around the endpoint and filled in. */
    kFGSPDFLineCapRound                 = 1,
    /** The stroke continues beyond the endpoint of the path for a distance equal to half the line width and is squared off. */
    kFGSPDFLineCapProject               = 2,
};
/** @brief Alias of enumeration for line cap styles. */
typedef UInt32 FGSPDFLineCapStyle;
    
/**
 * @brief Line join styles
 */
enum {
    /** The outer edges of the strokes for the two segments are extended  until they meet at an angle*/
    kFGSPDFLineJoinMiter                = 0,
    /** An arc of a circle with a diameter equal to the line width is drawn around the point where the two segments meet, connecting the outer edges of  the strokes for the two segments. */
    kFGSPDFLineJoinRound                = 1,
    /** The two segments are finished with butt caps and the resulting notch beyond the ends of the segments is filled with a triangle.  */
    kFGSPDFLineJoinBevel                = 2,
};
/** @brief Alias of enumeration for line join styles. */
typedef UInt32 FGSPDFLineJoinStyle;
    
/**
 * @brief Path point types
 */
enum {
    /** Specifies that the figure is automatically closed after the corresponding line 
     * or curve is drawn. The figure is closed by drawing a line from the line or 
     * curve endpoint to the point corresponding to the last PT_MOVETO. */
    kFGSPDFPathCloseFigure                = 1,
    /** Specifies that the previous point and the corresponding point in lpPoints are the endpoints of a line.*/		
    kFGSPDFPathLineTo                     = 2,	
        /** Specifies that the corresponding point in lpPoints is a control point or ending point for a Bézier curve.*/
    kFGSPDFPathBezierTo                   = 4,
    /** Specifies that the corresponding point in lpPoints starts a disjoint figure.*/
    kFGSPDFPathMoveTo                     = 6,
};
/** @brief Alias of enumeration for path point types. */
typedef UInt32 FGSPDFPathPointType;
    
/**
 * @brief Fill mode types
 */
enum {
    /** No fill color.*/
    kFGSPDFFillNull                       = 0,
    /** Represents a fill mode in which the system fills the area between odd-numbered and even-numbered polygon sides on each scan line.*/
    kFGSPDFFillAlternate                  = 1,
    /** Represents a fill mode in which the system uses the direction in which a figure was drawn to determine whether to fill the area.*/
    kFGSPDFFillWinding                    = 2,
};
/** @brief Alias of enumeration for fill mode types. */
typedef SInt32 FGSPDFFillModeType;
    
/**
 * @brief Text rendering modes
 */
enum {
    /** Fill text.*/
    kFGSPDFTextModeFill                   = 0,
    /** Stroke text. */
    kFGSPDFTextModeStroke                 = 1,
    /** Fill, then stroke text. */
    kFGSPDFTextModeFillAndStroke          = 2,
    /** Neither fill nor stroke text (invisible). */
    kFGSPDFTextModeInvisible              = 3,
};
/** @brief Alias of enumeration for text mode. */
typedef UInt32 FGSPDFTextMode;

/**
 * @brief Definitions for Image Types
 */
enum {
    /** The image type is BMP. */
    kFGSPDFImageTypeBmp                 = 1,
    /** The image type is JPG. */
    kFGSPDFImageTypeJpg                 = 2,
    /** The image type is PNG. */
    kFGSPDFImageTypePng                 = 3,
};
/** @brief Alias of enumeration for image types. */
typedef UInt32 FGSPDFImageType;

/**
 * @brief PDF annotation border types.
 */
enum {
    /** Unknow border.*/
    kFGSPDFAnnotBorderUnknow            = -1,
	/** Solid border.*/
	kFGSPDFAnnotBorderSolid             = 0,
	/** Dashed border.*/
	kFGSPDFAnnotBorderDashed            = 1,
	/** Underline border.*/
	kFGSPDFAnnotBorderUnderline         = 2,
	/** Beveled border.*/
	kFGSPDFAnnotBorderBeveled           = 3,
	/** Inset border.*/
	kFGSPDFAnnotBorderInset             = 4,
};
/** @brief Alias of enumeration for border types. */
typedef UInt32 FGSPDFAnnotBorderType;
/** @}*/

/**
 * @name Media Clip Content Types
 */
/**@{*/
/** @brief The Media Content Type is SWF. */
extern const CFStringRef kFPDFMimeTypeSWF;
/** @brief The Media Content Type is SPL. */
extern const CFStringRef kFPDFMimeTypeSPL;
/** @brief The Media Content Type is AVI. */
extern const CFStringRef kFPDFMimeTypeAVI;
/** @brief The Media Content Type is MPG. */
extern const CFStringRef kFPDFMimeTypeMPG;
/** @brief The Media Content Type is IVF. */
extern const CFStringRef kFPDFMimeTypeIVF;
/** @brief The Media Content Type is ASF. */
extern const CFStringRef kFPDFMimeTypeASF;
/** @brief The Media Content Type is ASX. */
extern const CFStringRef kFPDFMimeTypeASX;
/** @brief The Media Content Type is WM. */
extern const CFStringRef kFPDFMimeTypeWM;
/** @brief The Media Content Type is WMP. */
extern const CFStringRef kFPDFMimeTypeWMP;
/** @brief The Media Content Type is WMV. */
extern const CFStringRef kFPDFMimeTypeWMV;
/** @brief The Media Content Type is WMX. */
extern const CFStringRef kFPDFMimeTypeWMX;
/** @brief The Media Content Type is WVX. */
extern const CFStringRef kFPDFMimeTypeWVX;
/** @brief The Media Content Type is MOV. */
extern const CFStringRef kFPDFMimeTypeMOV;
/** @brief The Media Content Type is FLC. */
extern const CFStringRef kFPDFMimeTypeFLC;
/** @brief The Media Content Type is MP4. */
extern const CFStringRef kFPDFMimeTypeMP4;
/** @brief The Media Content Type is RMVB. */
extern const CFStringRef kFPDFMimeTypeRMVB;
/** @brief The Media Content Type is RMS. */
extern const CFStringRef kFPDFMimeTypeRMS;
/** @brief The Media Content Type is RJS. */
extern const CFStringRef kFPDFMimeTypeRJS;
/** @brief The Media Content Type is RMJ. */
extern const CFStringRef kFPDFMimeTypeRMJ;
/** @brief The Media Content Type is RMP. */
extern const CFStringRef kFPDFMimeTypeRMP;
/** @brief The Media Content Type is MPA. */
extern const CFStringRef kFPDFMimeTypeMPA;
/** @brief The Media Content Type is RP. */
extern const CFStringRef kFPDFMimeTypeRP;
/** @brief The Media Content Type is RT. */
extern const CFStringRef kFPDFMimeTypeRT;
/** @brief The Media Content Type is DV. */
extern const CFStringRef kFPDFMimeTypeDV;
/** @brief The Media Content Type is MPV. */
extern const CFStringRef kFPDFMimeTypeMPV;
/** @brief The Media Content Type is AIFF. */
extern const CFStringRef kFPDFMimeTypeAIFF;
/** @brief The Media Content Type is AU. */
extern const CFStringRef kFPDFMimeTypeAU;
/** @brief The Media Content Type is MID. */
extern const CFStringRef kFPDFMimeTypeMID;
/** @brief The Media Content Type is MIDI. */
extern const CFStringRef kFPDFMimeTypeMIDI;
/** @brief The Media Content Type is MP3. */
extern const CFStringRef kFPDFMimeTypeMP3;
/** @brief The Media Content Type is M3U. */
extern const CFStringRef kFPDFMimeTypeM3U;
/** @brief The Media Content Type is WAV. */
extern const CFStringRef kFPDFMimeTypeWAV;
/** @brief The Media Content Type is RAM. */
extern const CFStringRef kFPDFMimeTypeRAM;
/** @brief The Media Content Type is SDP. */
extern const CFStringRef kFPDFMimeTypeSDP;
/** @brief The Media Content Type is SMI. */
extern const CFStringRef kFPDFMimeTypeSMI;
/** @brief The Media Content Type is RTSP. */
extern const CFStringRef kFPDFMimeTypeRTSP;
/** @brief The Media Content Type is MP4. */
extern const CFStringRef kFPDFMimeTypeAUDIO_MP4;
/** @brief The Media Content Type is QCP. */
extern const CFStringRef kFPDFMimeTypeQCP;
/** @brief The Media Content Type is GSM. */
extern const CFStringRef kFPDFMimeTypeGSM;
/** @brief The Media Content Type is M4A. */
extern const CFStringRef kFPDFMimeTypeM4A;
/** @brief The Media Content Type is M4B. */
extern const CFStringRef kFPDFMimeTypeM4B;
/** @brief The Media Content Type is M4P. */
extern const CFStringRef kFPDFMimeTypeM4P;
/** @brief The Media Content Type is PLS. */
extern const CFStringRef kFPDFMimeTypePLS;
/** @brief The Media Content Type is RA. */
extern const CFStringRef kFPDFMimeTypeRA;
/** @brief The Media Content Type is WMA. */
extern const CFStringRef kFPDFMimeTypeWMA;
/** @brief The Media Content Type is WAX. */
extern const CFStringRef kFPDFMimeTypeWAX;
/** @brief The Media Content Type is RMM. */
extern const CFStringRef kFPDFMimeTypeRMM;
/**@}*/
  
/** 
 * @name FGSPDFBASE Enumeration Types
 */

/**@{*/
/**
 * @brief   PDF media permission type.
 *          Indicates the circumstances under which it is acceptable to write a temporary file in order to play a media clip.
 */
enum {
    /** Never allowed.*/
    kFGSPDFMediaPermissionTempNever = 0,
    /** Allowed only if the document permissions allow content extraction.*/
    kFGSPDFMediaPermissionTempExtract = 1,
    /** Allowed only if the document permissions allow content extraction, including for accessibility purposes.*/
    kFGSPDFMediaPermission_TempAccess = 2,
    /** Always allowed.*/
    kFGSPDFMediaPermission_TempAlways = 3,
};
/** @brief Alias of enumeration for media permission type. */
typedef UInt32 FGSPDFMediaPermissionType;
/**@}*/
    
/**
 * @brief Load CMaps for Adobe-GB1 character collection. Make use of character encoding maps embedded with GSDK.
 *
 * @details These functions add character encoding data to your application. 
 *			Each call will increase the code size of your application. 
 *			Total data size for all	character sets is around 434K bytes.
 *
 * @return None.
 */
void		FGSFontCMapLoadGB();

/**
 * @brief Load CMaps for Adobe-GB1 character collection. Same as ::FGSFontCMapLoadGB. 
 *
 * @details These functions add character encoding data to your application. 
 *			Each call will increase the code size of your application. 
 *			Total data size for all	character sets is around 434K bytes.
 *
 * @return None.
 */
void		FGSFontCMapLoadGBExt();

/**
 * @brief Load CMaps for Adobe-CNS1 character collection.
 *
 * @details These functions add character encoding data to your application. 
 *			Each call will increase the code size of your application. 
 *			Total data size for all	character sets is around 434K bytes.
 *
 * @return None.
 */
void		FGSFontCMapLoadCNS();

/**
 * @brief Load CMaps for Adobe-Korea1 character collection.
 *
 * @details These functions add character encoding data to your application. 
 *			Each call will increase the code size of your application. 
 *			Total data size for all	character sets is around 434K bytes.
 *
 * @return None.
 */
void		FGSFontCMapLoadKorea();

/**
 * @brief Load CMaps for Adobe-Japan1 character collection.
 *
 * @details These functions add character encoding data to your application. 
 *			Each call will increase the code size of your application. 
 *			Total data size for all	character sets is around 434K bytes.
 *
 * @return None.
 */
void		FGSFontCMapLoadJapan();

/**
 * @brief Load CMaps for Adobe-Japan1 character collection. Same as ::FGSFontCMapLoadJapan.
 *
 * @details These functions add character encoding data to your application. 
 *			Each call will increase the code size of your application. 
 *			Total data size for all	character sets is around 434K bytes.
 *
 * @return None.
 */
void		FGSFontCMapLoadJapanExt();
    
/**
 * @brief  Enable JBIG2 image decoder. 
 *
 * @details For embedded platform only and on desktop it's automatically loaded.
 *
 * @return None.
 *
 * @note If you want to display JBIG2 encoded images, you need to call these functions after the SDK initialized.<br>
 *		 Calling these functions will increase code size by about 200K-400K bytes.
 */
void        FGSLoadJbig2Decoder();
    
/**
 * @brief Enable JBIG2000 image decoder. 
 *
 * @details For embedded platform only  and on desktop it's automatically loaded.
 *
 * @return None.
 *
 * @note If you want to display JPEG2000 encoded images, you need to call 
 *		 these functions after the SDK initialized.<br>
 *		 Calling these functions will increase code size by about 200K-400K bytes.
 *		 JPEG2000 decoder may not be available on some platforms.
 */
void		FGSLoadJpeg2000Decoder();
    

#ifdef __cplusplus
};
#endif

#endif // _FPDF_BASE_H_

/**@}*/
